home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr44 / tge141.zip / QUICKREF.DOC < prev    next >
Text File  |  1995-01-23  |  28KB  |  469 lines

  1.  
  2.                           TGE 1.41 Quick Reference
  3.                Copyright (c) 1994-1995 by Matthew Hildebrand
  4.  
  5.  
  6. Initialization routines:
  7. =======================
  8.  
  9.   loadGraphDriver             Load a graphics driver.
  10.                               int loadGraphDriver(char *filename);
  11.   initGraphics                Initialize graphics mode.
  12.                               void initGraphics(void);
  13.   deInitGraphics              Initialize 80x25 colour text mode.
  14.                               void deInitGraphics(void);
  15.  
  16. Graphics primitives:
  17. ===================
  18.  
  19.   putPixel                    Place a single pixel on-screen.
  20.                               void putPixel(int x, int y, unsigned colour);
  21.   getPixel                    Get a single pixel from the screen.
  22.                               unsigned getPixel(int x, int y);
  23.   line                        Draw a line joining two points.
  24.                               void line(int x1, int y1, int x2, int y2,
  25.                                 unsigned colour);
  26.   horizLine                   Draw a horizontal line joining two points.
  27.                               void horizLine(int y, int x1, int x2,
  28.                                 unsigned colour);
  29.   vertLine                    Draw a vertical line joining two points.
  30.                               void vertLine(int x, int y1, ing y2, unsigned
  31.                                 colour);
  32.   drawRect                    Draw a regtangle outline.
  33.                               void drawRect(int ulx, int uly, int lrx, int
  34.                                 lry, unsigned colour);
  35.   filledRect                  Draw a filled rectangle.
  36.                               void filledRect(int ulx, int uly, int lrx,
  37.                                 int lry, unsigned colour);
  38.   ellipse                     Draw an ellipse outline.
  39.                               void ellipse(int x, int y, int wide, int
  40.                                 deep, unsigned colour);
  41.   filledEllipse               Draw a filled ellipse.
  42.                               void filledEllipse(int x, int y, int wide,
  43.                                 int deep, unsigned colour);
  44.   circle                      Draw a circle outline.
  45.                               void circle(int x, int y, int radius,
  46.                                 unsigned colour);
  47.   filledCircle                Draw a filled circle.
  48.                               void filledCircle(int x, int y, int radius,
  49.                                 unsigned colour);
  50.   clearGraphics               Clear the entire screen.
  51.                               void clearGraphics(unsigned colour);
  52.   fillRegion                  Floodfill a region of the screen with the
  53.                                 specified colour.
  54.                               void fillRegion(int x, int y, unsigned
  55.                                 colour);
  56.  
  57. Image-related functions:
  58. =======================
  59.  
  60.   putImage                    Put an image on-screen.
  61.                               void putImage(int x, int y, void *image);
  62.   putImageInv                 Put an image on-screen, treating zero pixels
  63.                                 as transparent.
  64.                               void putImageInv(int x, int y, void *image);
  65.   getImage                    Get an image from the screen.
  66.                               void getImage(int ulx, int uly, int lrx, int
  67.                                 lry, void *image);
  68.   imageSize                   Determine the amount of memory required to
  69.                                 store an image.
  70.                               unsigned long imageSize(int ulx, int uly, int
  71.                                 lrx, int lry);
  72.   imageSizeDim                Determine the amount of memory required to
  73.                                 store an image.
  74.                               unsigned long imageSizeDim(unsigned wide,
  75.                                 unsigned deep);
  76.   putHorizLine                Place one horizontal line of image data
  77.                                 on-screen.
  78.                               void putHorizLine(int y, int xOff, int
  79.                                 lineLen, void *buf);
  80.   putHorizLineInv             Place one horizontal line of image data
  81.                                 on-screen, treating zero pixels as
  82.                                 transparent.
  83.                               void putHorizLineInv(int y, int xOff, int
  84.                                 lineLen, void *buf);
  85.   getHorizLine                Get one horizontal line of image data from
  86.                                 the screen.
  87.                               void getHorizLine(int y, int xOff, int
  88.                                 lineLen, void *buf);
  89.   putHorizLine                Place one vertical line of image data
  90.                                 on-screen.
  91.                               void putVertLine(int x, int YOff, int
  92.                                 lineLen, void *buf);
  93.   putHorizLineInv             Place one vertical line of image data
  94.                                 on-screen, treating zero pixels as
  95.                                 transparent.
  96.                               void putVertLineInv(int x, int yOff, int
  97.                                 lineLen, void *buf);
  98.   getHorizLine                Get one vertical line of image data from the
  99.                                 screen.
  100.                               void getVertLine(int x, int yOff, int
  101.                                 lineLen, void *buf);
  102.   scaleBitmap                 Scale a bitmap.
  103.                               void *scaleBitmap(void *srcImage, unsigned
  104.                                 newWide, unsigned newDeep, void
  105.                                 *destImage);
  106.   imageWidth                  Return the width of an image.
  107.                               unsigned imageWidth(void *image);
  108.   imageHeight                 Return the height of an image.
  109.                               unsigned imageHeight(void *image);
  110.  
  111. Palette-related routines:
  112. ========================
  113.  
  114.   setPaletteReg               Set a single palette register.
  115.                               void setPaletteReg(unsigned palReg, unsigned
  116.                                 char red, unsigned char green, unsigned
  117.                                 char blue);
  118.   getPaletteReg               Get a single palette register.
  119.                               void getPaletteReg(unsigned palReg, unsigned
  120.                                 char *red, unsigned char *green, unsigned
  121.                                 char *blue);
  122.   setBlockPalette             Set a block of palette registers.
  123.                               void setBlockPalette(unsigned firstReg,
  124.                                 unsigned lastReg, void *data);
  125.   getBlockPalette             Get a block of palette registers.
  126.                               void getBlockPalette(unsigned firstReg,
  127.                                 unsigned lastReg, void *data);
  128.   colourCloseTo               Find a colour which closely matches the
  129.                                 specified 24-bit colour.
  130.                               unsigned colourCloseTo(unsigned char red,
  131.                                 unsigned char green, unsigned char blue);
  132.   colourCloseToX              Find a colour which closely matches the
  133.                                 specified 24-bit colour, excluding one
  134.                                 colour from the search.
  135.                               unsigned colourCloseToX(unsigned char red,
  136.                                 unsigned char green, unsigned char blue,
  137.                                 unsigned colourExclude);
  138.   fadePalette                 Fade one palette into another.
  139.                               int fadePalette(unsigned step, void *inPal,
  140.                                 void *outPal, void *targetPal);
  141.   greyPalette                 Produce a greyscale version of a palette.
  142.                               void greyPalette(void *inPal, void *outPal);
  143.   rotatePalette               Rotate a palette.
  144.                               void rotatePalette(int howMuch, void *inPal,
  145.                                 void *outPal);
  146.   promotePalette              Promote a 6-bit palette to 8-bit.
  147.                               void promotePalette(void *pal);
  148.   demotePalette               Demote an 8-bit palette to 6-bit.
  149.                               void demotePalette(void *pal);
  150.   replaceColour               Replace all instances of a colour within a
  151.                                 specified region.
  152.                               void replaceColour(int ulx, int uly, int lrx,
  153.                                 int lry, unsigned oldColour, unsigned
  154.                                 newColour);
  155.  
  156. Viewports and clipping:
  157. ======================
  158.  
  159.   setInputViewport            Set the defining coordinates of the input
  160.                                 viewport.
  161.                               void setInputViewport(int ulx, int uly, int
  162.                                 lrx, int lry);
  163.   setOutputViewport           Set the defining coordinates of the output
  164.                                 viewport.
  165.                               void setOutputViewport(int ulx, int uly, int
  166.                                 lrx, int lry);
  167.   setViewports                Set the defining coordinate of the input and
  168.                                 the output viewports.
  169.                               void setViewports(int ulx, int uly, int lrx,
  170.                                 int lry);
  171.   getInputViewport            Get the defining coordinates of the input
  172.                                 viewport.
  173.                               void getInputViewport(int *ulx, int *uly, int
  174.                                 *lrx, int *lry);
  175.   getOutputViewport           Get the defining coordinates of the output
  176.                                 viewport.
  177.                               void getOutputViewport(int *ulx, int *uly,
  178.                                 int *lrx, int *lry);
  179.   clipRect                    Clip a rectangle to within the current output
  180.                                 viewport.
  181.                               int clipRect(int *x1, int *y1, int *x2, int
  182.                                  *y2);
  183.   clipLine                    Clip a line to within the current output
  184.                                 viewport.
  185.                               int clipLine(int *x1, int *y1, int *x1, int
  186.                                 *y2);
  187.   clipInputPoint              Return a flag indicating whether or not the
  188.                                 specified coordinates lie within the
  189.                                 current input viewport.
  190.                               int clipInputPoint(int x, int y);
  191.   clipOutputPoint             Return a flag indicating whether or not the
  192.                                 specified coordinates lie within the
  193.                                 current output viewport.
  194.                               int clipOutputPoint(int x, int y);
  195.   pointOnScreen               Return a flag indicating whether or not the
  196.                                 specified coordinates lie on-screen.
  197.                               int pointOnScreen(int x, int y);
  198.  
  199. Virtual screens:
  200. ===============
  201.  
  202.   makeVirtScreen              Allocate memory for a virtual screen; can
  203.                                 also be used to allocate memory for an
  204.                                 image.
  205.                               void *makeVirtScreen(unsigned wide, unsigned
  206.                                 deep);
  207.   setGraphicsAddr             Set the location upon which graphics input
  208.                                 and output will both be performed.  Use
  209.                                 NULL for the screen, or a pointer to the
  210.                                 virtual screen to use.
  211.                               void setGraphicsAddr(void *addr);
  212.   setGraphicsInputAddr        Set the location upon which graphics input
  213.                                 will be performed.  Use NULL for the
  214.                                 screen, or a pointer to the virtual screen
  215.                                 to use.
  216.                               void setGraphicsInputAddr(void *addr);
  217.   setGraphicsOutputAddr       Set the location upon which graphics output
  218.                                 will be performed.  Use NULL for the
  219.                                 screen, or a pointer to the virtual screen
  220.                                 to use.
  221.                               void setGraphicsOutputAddr(void *addr);
  222.   getGraphicsInputAddr        Get the location upon which graphics input
  223.                                 will be performed.  Returns NULL for the
  224.                                 screen, or a pointer to the virtual screen
  225.                                 being used.
  226.                               void *getGraphicsInputAddr(void);
  227.   getGraphicsOutputAddr       Get the location upon which graphics output
  228.                                 will be performed.  Returns NULL for the
  229.                                 screen, or a pointer to the virtual screen
  230.                                 being used.
  231.                               void *getGraphicsOutputAddr(void);
  232.  
  233. Output modes:
  234. ============
  235.  
  236.   setGraphicsOutputMode       Select the output mode to use:  TGE_COPY_PUT,
  237.                                 TGE_AND_PUT, TGE_NOT_PUT, TGE_OR_PUT, or
  238.                                 TGE_XOR_PUT.
  239.                               void setGraphicsOutputMode(int mode);
  240.  
  241. Graphics files:
  242. ==============
  243.  
  244.   loadPalFile                 Load a palette data file.
  245.                               void *loadPalFile(char *filename, void
  246.                                 *addr);
  247.   savePalFile                 Save a palette data file.
  248.                               int savePalFile(char *filename, void *pal);
  249.   loadRawFile                 Load a RAW image file into memory.
  250.                               void *loadRawFile(char *filename);
  251.   saveRawFile                 Save a RAW image file to disk.
  252.                               int saveRawFile(char *filename, void *image);
  253.   displayRawFile              Display a RAW image file.
  254.                               int displayRawFile(int x, int y, char
  255.                                 *filename);
  256.   loadPcxFilePal              Load the palette from a PCX image file.
  257.                               void *loadPcxFilePal(char *filename, void
  258.                                 *addr);
  259.   loadPcxFile                 Load a PCX image file, and its palette if
  260.                                 requested, into memory.
  261.                               void *loadPcxFile(char *filename, char
  262.                                 *palette);
  263.   displayPcxFile              Display a PCX image file.
  264.                               int displayPcxFile(int x, int y, char
  265.                                 *filename);
  266.  
  267. Variable-size fonts:
  268. ===================
  269.  
  270.   VariableFont::load          Load a font from disk.
  271.                               int VariableFont::load(char *filename);
  272.   VariableFont::put           Put a string or character on-screen.
  273.                               void VariableFont::put(int x, int y, char
  274.                                 ch);
  275.                               void VariableFont::put(int x, int y, char
  276.                                 *ch);
  277.   VariableFont::width         Find the width of a string or character.
  278.                               unsigned VariableFont::width(char *string);
  279.                               unsigned VariableFont::width(char ch);
  280.   VariableFont::height        Find the height of a string or character.
  281.                               unsigned VariableFont::height(char *string);
  282.                               unsigned VariableFont::height(char ch);
  283.   VariableFont::maxWIdth      Return the width of the widest character.
  284.                               unsigned VariableFont::maxWidth(void);
  285.   VariableFont::maxHeight     Return the height of the tallest character.
  286.                               unsigned VariableFont::maxHeight(void);
  287.   VariableFont::matchColours  Match font colours to current palette.
  288.                               void VariableFont::matchColours(void);
  289.   VariableFont::palette       Get or set the entire font palette, or a
  290.                                 portion of it.
  291.                               void VariableFont::palette(void *data);
  292.                               void *VariableFont::palette(void);
  293.                               void VariableFont::palette(unsigned char
  294.                                 palReg, unsigned char red, unsigned char
  295.                                 green, unsigned char blue);
  296.                               void VariableFont::palette(unsigned char
  297.                                 palReg, unsigned char *red, unsigned char
  298.                                 *green, unsigned char *blue);
  299.   VariableFont::spacing       Get or set the current spacing value.
  300.                               unsigned VariableFont::spacing(void);
  301.                               void VariableFont::spacing(unsigned
  302.                                 numPixels);
  303.  
  304. Fixed-size fonts:
  305. ================
  306.  
  307.   FixedFont::load             Load a font from disk.
  308.                               int FixedFont::load(char *filename);
  309.   FixedFont::FixedFont        Initialize a FixedFont instance.
  310.                               FixedFont::FixedFont(unsigned char
  311.                                 foreground=1, unsigned char background=0);
  312.   FixedFont::width            Find the width of a string or character.
  313.                               unsigned FixedFont::width(char *string);
  314.                               unsigned FixedFont::width(char ch);
  315.   FixedFont::maxWidth         Return the width of the widest character.
  316.                               unsigned FixedFont::maxWidth(void);
  317.   FixedFont::height           Find the height of a string or character.
  318.                               unsigned FixedFont::height(char *string);
  319.                               unsigned FixedFont::height(char ch);
  320.   FixedFont::maxHeight        Return the height of the tallest character.
  321.                               unsigned FixedFont::maxHeight(void);
  322.   FixedFont::put              Put a string or character on-screen.
  323.                               void FixedFont::put(int x, int y, char ch);
  324.                               void FixedFont::put(int x, int y, char *ch);
  325.   FixedFont::foreground       Get or set the foreground colour.
  326.                               unsigned FixedFont::foreground(void);
  327.                               void FixedFont::foreground(unsigned colour);
  328.   FixedFont::background       Get or set the background colour.
  329.                               unsigned FixedFont::background(void);
  330.                               void FixedFont::background(unsigned colour);
  331.   FixedFont::charAddr         Get a character's bitimage address.
  332.                               void *FixedFont::charAddr(char ch);
  333.  
  334. Mouse-related functions:
  335. =======================
  336.  
  337.   initNewMouse                Initialize the new mouse handler.
  338.                               void initNewMouse(void);
  339.   deInitNewMouse              Deactivate the new mouse handler.
  340.                               void deInitNewMouse(void);
  341.   enableNewMouse              Re-enable the new mouse handler following a
  342.                                 call to disableNewMouse().
  343.                               void enableNewMouse(void);
  344.   disableNewMouse             Temporarily deactive the new mouse handler,
  345.                                 to be reactivated later by a call to
  346.                                 enableNewMouse().
  347.                               void disableNewMouse(void);
  348.   setupMousePointer           Select a mouse pointer bitmap.  This function
  349.                                 requires that the new mouse handler be
  350.                                 installed.
  351.                               void setupMousePointer(int pointerNum);
  352.   setPointerColours           Update the colours used to compose the mouse
  353.                                 pointer.
  354.                               void setPointerColours(void);
  355.   resetMouse                  Reset the mouse driver and hardware.  Returns
  356.                                 non-zero if a mouse driver is available.
  357.                               int resetMouse(void);
  358.   getButtonsMouse             Return the number of buttons on the mouse.
  359.                               int getButtonsMouse(void);
  360.   showMouse                   Show the mouse pointer.
  361.                               void showMouse(void);
  362.   hideMouse                   Hide the mouse pointer.
  363.                               void hideMouse(void);
  364.   getPosMouse                 Get the current mouse pointer position.
  365.                               void getPosMouse(int *x, int *y);
  366.   setPosMouse                 Set the mouse pointer position.
  367.                               void setPosMouse(unsigned x, unsigned y);
  368.   leftButtonMouse             Return non-zero if the left button is down.
  369.                               int leftButtonMouse(void);
  370.   rightButtonMouse            Return non-zero if the right button is down.
  371.                               int rightButtonMouse(void);
  372.   centerButtonMouse           Return non-zero if the center button is down.
  373.                               int centerButtonMouse(void);
  374.   buttonPressMouse            Return the number of times the specified
  375.                                 button has been pressed since the last call
  376.                                 to this function (with the same button
  377.                                 parameter), and store the coordinates of
  378.                                 the last press.
  379.                               unsigned buttonPressMouse(unsigned button,
  380.                                 int *x, int *y);
  381.   buttonReleaseMouse          Return the number of times the specified
  382.                                 button has been released since the last
  383.                                 call to this function (with the same button
  384.                                 parameter), and store the coordinates of
  385.                                 the last release.
  386.                               unsigned buttonPressMouse(unsigned button,
  387.                                 int *x, int *y);
  388.   setHorizLimitsMouse         Set the maximum and minimum horizontal limits
  389.                                 for the mouse pointer.
  390.                               void setHorizLimitsMouse(unsigned min,
  391.                                 unsigned max);
  392.   setVertLimitsMouse          Set the maximum and minimum vertical limits
  393.                                 for the mouse pointer.
  394.                               void setVertLimitsMouse(unsigned min,
  395.                                 unsigned max);
  396.   setPointerMouse             Set the shape of the mouse pointer.  This
  397.                                 function can only select 256-colour bitmaps
  398.                                 when the new mouse handler is installed.
  399.                               void setPointerMouse(int xOff, int yOff, void
  400.                                 *image);
  401.   getSaveSizeMouse            Return the size of the buffer necessary to
  402.                                 store the state of the mouse driver.
  403.                               unsigned getSaveSizeMouse(void);
  404.   saveStateMouse              Save the current state of the mouse pointer.
  405.                               void saveStateMouse(void *buf);
  406.   restoreStateMouse           Restore a previously saved state of the mouse
  407.                                 pointer.
  408.                               void restoreStateMouse(void *buf);
  409.   setRatioMouse               Set the mouse sensitivity, in units of
  410.                                 mickeys per 8 pixels of pointer movement.
  411.                               void setRatioMouse(unsigned horiz, unsigned
  412.                                 vert);
  413.   getSensitivityMouse         Get the mouse sensitivity, in units of
  414.                                 mickeys per 8 pixels of pointer movement.
  415.                                 The mouse double speed threshold (the
  416.                                 minimum number of mickeys per second of
  417.                                 motion before pointer movement is doubled)
  418.                                 is retrieved as well.
  419.   softResetMouse              Reset the mouse driver, but not the mouse
  420.                                 hardware.
  421.                               void softResetMouse(void);
  422.   waitReleaseMouse            If the specified button is not already up,
  423.                                 wait until it is released, then return.
  424.                               void waitReleaseMouse(int button);
  425.  
  426. Virtual coordinate system:
  427. =========================
  428.  
  429.   VirtualCoord::VirtualCoord  Create an instance of the virtual coordinate
  430.                                 system object.
  431.                               VirtualCoord::VirtualCoord(void);
  432.                               VirtualCoord::VirtualCoord(unsigned virtMaxX,
  433.                                 unsigned virtMaxY, unsigned realMaxX,
  434.                                 unsigned realMaxY);
  435.   VirtualCoord::virtParams    Set or get the maximum virtual x- and
  436.                                 y-coordinates.
  437.                               void VirtualCoord::virtParams(unsigned
  438.                                 virtMaxX, unsigned virtMaxY);
  439.                               void VirtualCoord::virtParams(unsigned
  440.                                 *virtMaxX, unsigned *virtMaxY);
  441.   VirtualCoord::realParams    Set or get the maximum real x- and
  442.                                 y-coordinates.
  443.                               void VirtualCoord::realParams(unsigned
  444.                                 realMaxX, unsigned realMaxY);
  445.                               void VirtualCoord::realParams(unsigned
  446.                                 *realMaxX, unsigned *realMaxY);
  447.   VirtualCoord::realCoords    Calculate the real (x,y) coordinates given
  448.                                 the virtual coordinates.
  449.                               void VirtualCoord::realCoords(unsigned virtX,
  450.                                 unsigned virtY, unsigned *realX, unsigned
  451.                                 *realY);
  452.   VirtualCoord::realX         Calculate the real x-coordinate given the
  453.                                 virtual x-coordinate.
  454.                               unsigned VirtualCoord::realX(unsigned virtX);
  455.   VirtualCoord::realY         Calculate the real y-coordinate given the
  456.                                 virtual y-coordinate.
  457.                               unsigned VirtualCoord::realY(unsigned virtY);
  458.   VirtualCoord::virtCoords    Calculate the virtual (x,y) coordinates given
  459.                                 the real coordinates.
  460.                               void VirtualCoord::virtCoords(unsigned realX,
  461.                                 unsigned realY, unsigned *virtX, unsigned
  462.                                 *virtY);
  463.   VirtualCoord::virtX         Calculate the virtual x-coordinate given the
  464.                                 real x-coordinate.
  465.                               unsigned VirtualCoord::virtX(unsigned realX);
  466.   VirtualCoord::virtY         Calculate the virtual y-coordinate given the
  467.                                 real y-coordinate.
  468.                               unsigned VirtualCoord::virtY(unsigned realY);
  469.